package com.heima.apis.article;

import com.heima.apis.article.fallback.IArticleClientFallback;
import com.heima.model.article.dtos.ArticleCommentDto;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmNewsCommentDto;
import com.heima.model.wemedia.dtos.WmNewsPageReqDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "leadnews-article", fallback = IArticleClientFallback.class)
public interface IArticleClient {
    /**
     * 保存文章到APP端
     *
     * @param articleDto
     * @return
     */
    @PostMapping("/api/v1/article/save")
    public ResponseResult save(@RequestBody ArticleDto articleDto);

    @PostMapping("/api/v1/comment/commentList")
    PageResponseResult findNewsComments(@RequestBody ArticleCommentDto dto);

    @PostMapping("/api/v1/comment/status")
    ResponseResult update_comment_status(@RequestBody WmNewsCommentDto dto);

    @PostMapping("/api/v1/statistics/newsDimension")
    ResponseResult newsDimension(@RequestBody WmNewsPageReqDto dto);

    @PostMapping("/api/v1/statistics/newsPage")
    PageResponseResult newsPage(@RequestBody WmNewsPageReqDto dto);

    @PostMapping("(/api/v1/comment/isComment")
    Boolean isComment(@RequestBody Long articleId);

    @PostMapping("(/api/v1/statistics/newsDetail")
    ResponseResult newsDetail(@RequestBody WmNewsPageReqDto dto);

    @PostMapping("/api/v1/comment/manage/delCom")
    void reduceComment(@RequestBody Long articleId);
}
